package org.jeecg.modules.inspection.service.impl;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.inspection.entity.Inspection;
import org.jeecg.modules.inspection.entity.InspectionException;
import org.jeecg.modules.inspection.entity.InspectionTaskRank;
import org.jeecg.modules.inspection.mapper.InspectionMapper;
import org.jeecg.modules.inspection.service.IInspectionService;
import org.jeecg.modules.inspection.vo.InspectionReportVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 巡检主表
 * @Author: jeecg-boot
 * @Date:   2019-09-26
 * @Version: V1.0
 */
@Service
public class InspectionServiceImpl extends ServiceImpl<InspectionMapper, Inspection> implements IInspectionService {

    @Autowired
    private InspectionMapper inspectionMapper;
    @Override
    public Integer updateStatus(Inspection inspection) {
        return inspectionMapper.updateStatus(inspection);
    }

    @Override
    public InspectionException selectOfficeConfig(String officeId,Integer problemsType) {
        return inspectionMapper.selectOfficeConfig(officeId,problemsType);
    }

    @Override
    public List<Inspection> selectAllItem(String userId) {
        return inspectionMapper.selectAllItem(userId);
    }

    @Override
    public Page<Inspection> listByProject(Page<Inspection> pageList, Inspection inspection) {
        return pageList.setRecords(inspectionMapper.listByProject(pageList,inspection));
    }

    @Override
    public List<InspectionReportVO> queryReportByLine(String processId) {
        return inspectionMapper.queryReportByLine(processId);
    }

    @Override
    public List<InspectionException> queryConfig(String officeId) {
        return inspectionMapper.queryConfig(officeId);
    }

    @Override
    public List<InspectionTaskRank> selectAllPlan(IPage page,InspectionTaskRank inspectionTaskRank) {
        return inspectionMapper.selectAllPlan(page,inspectionTaskRank);
    }

    @Override
    public List<Inspection> selectPlanCountData(String userId, String date) {
        return inspectionMapper.selectPlanCountData(userId,date);
    }
}
